﻿@{ Layout = null; }

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>1.常规盖章</title>
    <!--**************   卓正 PageOffice 客户端代码开始    ************************-->
    <script type="text/javascript">
        function Save() {
            var myObject = {};
            myObject.folderName = "AddSeal1";
            var params = new URLSearchParams(myObject);
            var saveUrl = "/InsertSeal/PDF/SaveFile";
            pdfctrl.SaveFilePage = `${saveUrl}?${params.toString()}`;
            pdfctrl.WebSave();
        }

        function InsertSeal() {
            try {
                pdfctrl.zoomseal.AddSeal();//如果使用ZoomSeal中的USBKEY方式盖章，第一个参数不能为盖章用户登录名，只能为null或者空字符串
            } catch (e) { }
        }

        function PrintFile() {
            pdfctrl.ShowDialog(4);
        }

        function SwitchFullScreen() {
            pdfctrl.FullScreen = !pdfctrl.FullScreen;
        }

        function SwitchBKMK() {
            pdfctrl.BookmarksVisible = !pdfctrl.BookmarksVisible;
        }

        function SetPageReal() {
            pdfctrl.SetPageFit(1);
        }

        function SetPageFit() {
            pdfctrl.SetPageFit(2);
        }

        function SetPageWidth() {
            pdfctrl.SetPageFit(3);
        }

        function ZoomIn() {
            pdfctrl.ZoomIn();
        }

        function ZoomOut() {
            pdfctrl.ZoomOut();
        }

        function FirstPage() {
            pdfctrl.GoToFirstPage();
        }

        function PreviousPage() {
            pdfctrl.GoToPreviousPage();
        }

        function NextPage() {
            pdfctrl.GoToNextPage();
        }

        function LastPage() {
            pdfctrl.GoToLastPage();
        }

        function SetRotateRight() {
            pdfctrl.RotateRight();
        }

        function SetRotateLeft() {
            pdfctrl.RotateLeft();
        }

        function Close() {
            pdfctrl.CloseWindow();
        }

        function OnPDFCtrlInit() {
            pdfctrl.AddCustomToolButton("保存", "Save()", 1);
            pdfctrl.AddCustomToolButton("加盖印章", "InsertSeal()", 2);
            pdfctrl.AddCustomToolButton("打印", "PrintFile()", 6);
            pdfctrl.AddCustomToolButton("-", "", 0);
            if (("linux") != (pageofficectrl.ClientOS)) {
                pdfctrl.AddCustomToolButton("显示/隐藏书签", "SwitchBKMK()", 0);
            }
            pdfctrl.AddCustomToolButton("实际大小", "SetPageReal()", 16);
            pdfctrl.AddCustomToolButton("适合页面", "SetPageFit()", 17);
            pdfctrl.AddCustomToolButton("适合宽度", "SetPageWidth()", 18);
            pdfctrl.AddCustomToolButton("-", "", 0);
            pdfctrl.AddCustomToolButton("首页", "FirstPage()", 8);
            pdfctrl.AddCustomToolButton("上一页", "PreviousPage()", 9);
            pdfctrl.AddCustomToolButton("下一页", "NextPage()", 10);
            pdfctrl.AddCustomToolButton("尾页", "LastPage()", 11);
            pdfctrl.AddCustomToolButton("-", "", 0);
            pdfctrl.AddCustomToolButton("向左旋转90度", "SetRotateLeft()", 12);
            pdfctrl.AddCustomToolButton("向右旋转90度", "SetRotateRight()", 13);
        }

    </script>
</head>
<body>

    <!--**************   卓正 PageOffice 客户端代码结束    ************************-->
    <form id="form1" runat="server">
        <div id="content" style="height:98vh;width:auto;">
            @Html.Raw(ViewBag.pdfCtrl)
        </div>
    </form>
</body>
</html>


